﻿using WebApiClientCore;
using WebApiClientCore.Attributes;
using BPM.Web.Shared.Data;
namespace BPM.Web.Shared.Service;

public interface IDictTypeClient : IHttpApi
{
    /// <summary>
    /// 分页查询字典类型
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpGet("sysDictType/page")]
    ITask<XnRestfulResult<PageResult<SysDictType>>> PageAsync(DictTypePageInput body, CancellationToken token = default);

    /// <summary>
    /// 获取字典类型列表
    /// </summary>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpGet("sysDictType/list")]
    ITask<XnRestfulResult<List<SysDictType>>> ListAsync(CancellationToken token = default);

    /// <summary>
    /// 获取字典类型下所有字典值
    /// </summary>
    /// <param name="code"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpGet("sysDictType/dropDown")]
    ITask<XnRestfulResult<List<SysDictData>>> DropDownAsync(string code, CancellationToken token = default);

    /// <summary>
    /// 添加字典类型
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpPost("sysDictType/add")]
    ITask<XnRestfulResult<string>> AddAsync(AddDictTypeInput body, CancellationToken token = default);

    /// <summary>
    /// 删除字典类型
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpPost("sysDictType/delete")]
    ITask<XnRestfulResult<string>> DeleteAsync(DeleteDictTypeInput body, CancellationToken token = default);

    /// <summary>
    /// 更新字典类型
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpPost("sysDictType/edit")]
    ITask<XnRestfulResult<string>> EditAsync(UpdateDictTypeInput body, CancellationToken token = default);

    /// <summary>
    /// 字典类型详情
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpGet("sysDictType/detail")]
    ITask<XnRestfulResult<SysDictType>> DetailAsync(QueryDictTypeInput body, CancellationToken token = default);

    /// <summary>
    /// 更新字典类型状态
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpPost("sysDictType/changeStatus")]
    ITask<XnRestfulResult<string>> ChangeStatusAsync(ChangeStateDictTypeInput body, CancellationToken token = default);

    /// <summary>
    /// 字典类型与字典值构造的字典树
    /// </summary>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpGet("sysDictType/tree")]
    ITask<XnRestfulResult<List<DictTreeOutput>>> TreeAsync(CancellationToken token = default);
}
